#include <sys/stat.h>
#include <fcntl.h>
#include <stdio.h>
#include <poll.h>
#include <signal.h>
#include <sys/types.h>
#include <unistd.h>
#include <fcntl.h>

int fd;

int main(int argc, char **argv)
{
    int ret = 0;
    unsigned char key_val;
    fd = open("/dev/buttons", O_RDWR);
    if (fd < 0)
    {
        printf("can't open \n");
    }
    while (1)
    {
        read(fd, &key_val, 1);
        printf("key_val: 0x%x\n", key_val);
    }
    return 0;
}

